package cn.virens.cmpt.redis;

import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.async.RedisAsyncCommands;
import io.lettuce.core.api.reactive.RedisReactiveCommands;
import io.lettuce.core.api.sync.RedisCommands;

public interface RedisManage {
	/** 释放当前Redis连接 */
	void close();

	/** 获取 Redis 连接 (绑定到线程) */
	StatefulRedisConnection<String, String> open();

	/** 同步执行 Redis 操作 */
	void sync(RedisExecute<RedisCommands<String, String>> execute);

	/** 异步执行 Redis 操作 */
	void async(RedisExecute<RedisAsyncCommands<String, String>> execute);

	/** 响应式执行 Redis 操作 */
	void reactive(RedisExecute<RedisReactiveCommands<String, String>> execute);

}
